<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<script>
    const arr = [
        {
            a: 10, b: 20, c: 50, msg: 'success'
        }, {
            a: 15, b: 30, c: 150, msg: 'error'
        }, {
            a: 20, b: 50, c: 250, msg: 'info'
        }, {
            a: 25, b: 60, c: 350, msg: 'warn'
        }
    ]

    let obj = {a: 0, b: 0, c: 0, msg: 0}

    for (let item in obj) {
        let result = arr.reduce((pre, cur) => {
            return pre + cur[item]
        }, 0)

        obj[item] = !isNaN(parseInt(result)) ? parseInt(result) : '--'
    }

    console.log(obj)

</script>
</body>
</html>